home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / kernserv / insertmsg.h < prev    next >
Text File  |  1995-02-14  |  6KB  |  221 lines

  1. /*    @(#)insertmsg.h    2.0    02/14/90    (c) 1990 NeXT    
  2.  *
  3.  * insertmsg.h -- Structs used for "Disk Inserted" messages. 
  4.  *
  5.  * HISTORY
  6.  * 01-Oct-90    Doug Mitchell
  7.  *    Added in_flags, IND_FLAGS_REMOVABLE
  8.  * 23-Apr-90    Doug Mitchell
  9.  *    Added oid_dev_str to of_insert_notify_dev
  10.  * 14-Feb-90    Doug Mitchell at NeXT
  11.  *    Created.
  12.  *
  13.  */
  14.  
  15. #ifndef    _INSERTMSG_
  16. #define _INSERTMSG_
  17.  
  18. #import <sys/types.h>
  19. #import <mach/message.h>
  20.  
  21. #define SUPPORT_PORT_DEVICE    0
  22.  
  23. /*
  24.  * msg_id's for messages used by vol driver.
  25.  */
  26. #define VOL_MSG_ID        0x355
  27. #define VOL_CHECK_MSG_ID    (VOL_MSG_ID+0)    /* new disk insert */
  28. #define VOL_PANEL_REQ        (VOL_MSG_ID+1)    /* panel request */
  29. #define VOL_PANEL_RESP        (VOL_MSG_ID+2)    /* panel response */
  30. #define VOL_PANEL_CANCEL    (VOL_MSG_ID+3)    /* panel cancel */
  31.  
  32. #define FORM_TYPE_LENGTH    64
  33.  
  34. /*
  35.  * New disk insertion notification (msg_id == VOL_CHECK_MSG_ID).
  36.  */
  37. struct insert_notify {
  38.     msg_header_t        in_header;
  39.     msg_type_t        in_vd_type;
  40.     int            in_vol_state;    /* IND_VS_xxx */
  41.     int            in_dev_desc;    /* IND_DD_xxx */
  42.     msg_type_t        in_flags_type;
  43.     int            in_flags;    /* IND_FLAGS_xxx */
  44.     msg_type_t        in_ft_type;
  45.     /*
  46.      * in_form_type contains the legal densities with with the 
  47.      * given media can be formatted, sprintf'd as decimal numbers
  48.      * of KBytes and separated by spaces. String is empty if disk
  49.      * if formatted.
  50.      */
  51.     char            in_form_type[FORM_TYPE_LENGTH];
  52.     /*
  53.      * dev_t or port follows...
  54.      */
  55. };
  56.  
  57. /*
  58.  * This struct will be used by fd, od, and SCSI drivers.
  59.  */
  60. #define OID_DEVSTR_LEN        6
  61.  
  62. struct of_insert_notify_dev {
  63.     struct insert_notify    oid_header;
  64.     msg_type_t        oid_dev_type;
  65.     dev_t            oid_bdev_t;    /* block device */
  66.     dev_t            oid_cdev_t;    /* raw device */
  67.     msg_type_t        oid_ds_type;
  68.     char            oid_dev_str[OID_DEVSTR_LEN];
  69.                         /* e.g., "fd0", "fd1" */
  70. };
  71.  
  72. #if    SUPPORT_PORT_DEVICE
  73.  
  74. /*
  75.  * For loadable drivers.
  76.  */
  77. struct of_insert_notify_port {
  78.     struct insert_notify    oip_header;
  79.     msg_type_t        oip_p_type;
  80.     port_t            oip_port;    /* describes other devices */
  81. };
  82.  
  83. #endif    SUPPORT_PORT_DEVICE
  84.  
  85. /*
  86.  * in_vol_state values
  87.  */
  88. #define IND_VS_LABEL        0x00        /* volume contains valid Mach
  89.                          * label */
  90. #define IND_VS_FORMATTED    0x01        /* volume is formatted but
  91.                          * contains no label */
  92. #define IND_VS_UNFORMATTED    0x02        /* unformatted */
  93.  
  94. /*
  95.  * in_dev_desc values
  96.  */
  97. #define IND_DD_DEV        0x00        /* oin_dev_t contains a dev_t
  98.                          * for a device in /dev */
  99. #define IND_DD_PORT        0x01        /* oin_port contains a port
  100.                          * for a loadable server */
  101.  
  102. /*
  103.  * in_flags values
  104.  */
  105. #define IND_FLAGS_REMOVABLE    0x00000001    /* 1 = removable; 0 = fixed */
  106. #define IND_FLAGS_FIXED        0x00000000
  107. #define IND_FLAGS_WP        0x00000002    /* 1 = write protected */
  108.  
  109. /*
  110.  * Panel request (msg_id == VOL_PANEL_REQ)
  111.  */
  112. #define VP_STRING_LEN        40
  113.  
  114. struct vol_panel_req {
  115.     msg_header_t        pr_header;
  116.     msg_type_t        pr_int_desc;    /* describes following 7
  117.                          * fields */
  118.     int            pr_panel_type;    /* PR_PT_xxx */
  119.     int            pr_resp_type;    /* PR_RT_xxx */
  120.     int             pr_tag;        /* identifies this panel */
  121.     /*
  122.      * meanings of these parameters vary per pr_panel_type.
  123.      */
  124.     int            pr_p1;
  125.     int            pr_p2;
  126.     int             pr_p3;
  127.     int            pr_p4;
  128.     msg_type_t        pr_string_desc;    /* describes following 2
  129.                          * fields */
  130.     char            pr_string1[VP_STRING_LEN];
  131.     char            pr_string2[VP_STRING_LEN];
  132. };
  133.  
  134. /*
  135.  * pr_panel_type values
  136.  */
  137. #define PR_PT_DISK_NUM        0    /* insert disk <p1> in 
  138.                      * <p2>(scsi|floppy|optical) drive <p3>
  139.                      */
  140. #define PR_PT_DISK_LABEL    1    /* insert disk <string1> in 
  141.                      * <p2>(scsi|floppy|optical) drive <p3>
  142.                      */
  143. #define PR_PT_DISK_NUM_W    2    /* wrong disk - insert disk <p1> in 
  144.                      * <p2>(scsi|floppy|optical) drive <p3>
  145.                      */
  146. #define PR_PT_DISK_LABEL_W    3    /* wrong disk - insert disk <string1>
  147.                      * in <p2>(scsi|floppy|optical) drive 
  148.                      * <p3>
  149.                      */
  150. #define PR_PT_SWAPDEV_FULL    4    /* swap device full */
  151. #define PR_PT_FILESYS_FULL    5    /* file system <string1> full */
  152. #define PR_RT_EJECT_REQ        6    /* eject disk in <p2> drive <p3> */
  153.  
  154. /*
  155.  * p2 values for PR_PT_DISK_NUM / PR_PT_DISK_LABEL
  156.  */
  157. #define PR_DRIVE_FLOPPY        0    /* floppy disk */
  158. #define PR_DRIVE_OPTICAL    1    /* OMD-1 (5.25") optical */
  159. #define PR_DRIVE_SCSI        2    /* removable SCSI disk */
  160.  
  161. /*
  162.  * pr_response_type values. Describes both format of panel and expected 
  163.  * response by Workspace Manager.
  164.  */
  165. #define PR_RT_NONE        0    /* no acknowledgement expected, no
  166.                      * cancel necesary */
  167. #define PR_RT_CANCEL        1    /* no ack; leave panel up until 
  168.                      * vol_panel_cancel message */
  169. #define PR_RT_ACK        2    /* just "OK" ack */
  170. #define PR_RT_INT        3    /* integer value expected */
  171.  
  172. /*
  173.  * Examples: 
  174.  *   'Insert floppy disk 3 in drive 0'
  175.  *    pr_panel_type      = PR_PT_DISK_NUM
  176.  *    p1          = 3
  177.  *    p2          = PR_DRIVE_FLOPPY
  178.  *    p3          = 0
  179.  *    pr_response_type = PR_RT_ACK (acknowledgement means "disk not 
  180.  *                   avaliable")
  181.  *
  182.  *   'Insert Optical disk "MyDisk" in drive 1'
  183.  *    pr_panel_type      = PR_PT_DISK_LABEL
  184.  *    string1         = "MyDisk"
  185.  *    p2          = PR_DRIVE_OPTICAL
  186.  *    p3          = 1
  187.  *    pr_response_type = PR_RT_ACK (acknowledgement means "disk not 
  188.  *                   avaliable")
  189.  *
  190.  *   'Swap Device Full'
  191.  *    pr_panel_type      = PR_PT_SWAPDEV_FULL
  192.  *    pr_response_type = PR_RT_ACK (acknowledgement means "OK to send more
  193.  *               of these messages") 
  194.  */
  195.  
  196. /*
  197.  * Panel response (msg_id == VOL_PANEL_RESP). Sent by Workspace Manager to 
  198.  * vol driver when use responds to panels with pr_response_type of PR_RT_ACK
  199.  * and PR_RT_INT.
  200.  */
  201. struct vol_panel_resp {
  202.     msg_header_t        ps_header;
  203.     msg_type_t        ps_int_desc;    /* describes following 2
  204.                          * fields */
  205.     int            ps_tag;        /* identifies panel request */
  206.     int            ps_value;    /* n/u for PR_RT_ACK requests;
  207.                          * integer for PR_RT_INT */
  208. };
  209.  
  210. /*
  211.  * Panel cancel request (msg_id == VOL_PANEL_CANCEL). Sent by vol driver to
  212.  * remove existing panel.
  213.  */
  214. struct vol_panel_cancel {
  215.     msg_header_t        pc_header;
  216.     msg_type_t        pc_int_desc;    /* describes following field */
  217.     int            pc_tag;        /* identifies panel request */
  218. };
  219.  
  220. #endif    _INSERTMSG_
  221.